﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Honestysoft.Financing.Model;
using Honestysoft.Baseframework.WebUI;
using System.IO;

namespace Honestysoft.Financing.WebUI.Module.Audit
{
    public partial class Bu_AuditTable_Print : System.Web.UI.Page
    {
        //protected string _ExcelFilePath = "";

        //private void Export()
        //{
        //    _ExcelFilePath = AuditUtils.ExportToExcel(Request.QueryString["ID"]);
        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {                
                //System.Threading.Thread.Sleep(1000);
                bool bExists = false;
                string fileName = Globals.Home + "Reports/" + Request.QueryString["BatchNo"] + "/" + Request.QueryString["Code"] + ".swf";
                bExists = File.Exists(Server.MapPath(fileName));
                while (!bExists)
                {
                    System.Threading.Thread.Sleep(2000);
                    bExists = File.Exists(Server.MapPath(fileName));
                }
                Response.Redirect(fileName);
            }
        }

        private void OutputToExcel(Bu_AuditTable atTable)
        { 
        }
    }
}